﻿<Window x:Class="AzureStorageExplorer.UploadEntitiesDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:controls="clr-namespace:AzureStorageExplorer"
        Title="Upload Entities" Height="330" Width="600" ResizeMode="NoResize"
        WindowStartupLocation="CenterOwner">
    <StackPanel Orientation="Vertical">
        <StackPanel Margin="12" Orientation="Vertical">

            <TextBlock Margin="0,0,0,4" Text="Upload from file:"></TextBlock>
            <StackPanel Orientation="Horizontal">
                <StackPanel Width="440" Margin="0,0,12,0">
                    <TextBox x:Name="InputFile" Margin="0,2,0,0" Background="LightYellow"></TextBox>
                </StackPanel>
                <Button x:Name="CmdSelectInputFile" Padding="4" Margin="0,0,8,0" Click="CmdSelectInputFile_Click">Select Input File</Button>
            </StackPanel>

            <TextBlock Margin="0,0,0,8" Text="File Format:"></TextBlock>
            <StackPanel Orientation="Vertical" Margin="0,0,0,12">
                <RadioButton x:Name="UploadFormatCSV" GroupName="UploadFormat" IsChecked="True" Margin="0,0,16,0" Checked="UploadFormat_Checked">CSV - Comma-Separated Values file (Excel-readable)</RadioButton>
                <RadioButton x:Name="UploadFormatJSON" GroupName="UploadFormat" Checked="UploadFormat_Checked">JSON- JavaScript Object Notation file</RadioButton>
                <RadioButton x:Name="UploadFormatXML" GroupName="UploadFormat" Checked="UploadFormat_Checked">XML - eXtensible Markup Language file</RadioButton>
            </StackPanel>

            <StackPanel x:Name="EntityXPathPanel" Orientation="Horizontal" Margin="0,0,0,0" Visibility="Collapsed">
                <TextBlock Margin="0,4,0,0" Width="150">Entity XPath:</TextBlock>
                <Border BorderThickness="1" BorderBrush="Gray" Width="300" Margin="16,0,0,0" Padding="0,0,0,0" >
                    <TextBox x:Name="EntityXPath" Background="LightYellow">//Entities/Entity</TextBox>
                </Border>
            </StackPanel>
            <StackPanel x:Name="OuterElementPanel" Orientation="Horizontal" Margin="0,0,0,0" Visibility="Collapsed">
                <TextBlock Margin="0,4,0,0" Width="150">Outer element name:</TextBlock>
                <Border BorderThickness="1" BorderBrush="Gray" Width="300" Margin="16,0,0,0" Padding="0,0,0,0" >
                    <TextBox x:Name="OuterElementName" Background="LightYellow">Entities</TextBox>
                </Border>
            </StackPanel>
            <StackPanel Orientation="Horizontal" Margin="0,0,0,0">
                <TextBlock Margin="0,4,0,0" Width="150">PartitionKey Field Name:</TextBlock>
                <Border BorderThickness="1" BorderBrush="Gray" Width="300" Margin="16,0,0,0" Padding="0,0,0,0" >
                    <TextBox x:Name="PartitionKeyColumnName" Background="LightYellow">PartitionKey</TextBox>
                </Border>
            </StackPanel>
            <StackPanel Orientation="Horizontal" Margin="0,0,0,0">
                <TextBlock Margin="0,4,0,0" Width="150">RowKey Field Name:</TextBlock>
                <Border BorderThickness="1" BorderBrush="Gray" Width="300" Margin="16,0,0,0" Padding="0,0,0,0" >
                    <TextBox x:Name="RowKeyColumnName" Background="LightYellow">RowKey</TextBox>
                </Border>
            </StackPanel>

            <StackPanel Orientation="Horizontal" Margin="0,12,0,0">
                <RadioButton x:Name="StopOnError" GroupName="ErrorHandling" IsChecked="True" Margin="0,0,16,0">Stop uploading if an insert error occurs</RadioButton>
                <RadioButton x:Name="ContinuePastErrors" GroupName="ErrorHandling">Continue uploading when insert errors occur</RadioButton>
            </StackPanel>

            <StackPanel x:Name="ButtonPanel" Orientation="Horizontal"  Margin="0,12,0,0">
                <Button x:Name="CmdUpload" IsDefault="True" Padding="4" Margin="0,0,8,0" Click="CmdUpload_Click">Upload</Button>
                <Button x:Name="CmdCancel" IsCancel="true" Padding="4" Click="CmdCancel_Click">Cancel</Button>
            </StackPanel>
        </StackPanel>
    </StackPanel>
</Window>
